package com.ssy.jt808.gateway.sdk.terminal.constant.location.addition;

import java.util.Map;
import java.util.TreeMap;

/**
 * @author zeno
 */
public enum InOutAreaDirectionEnum{
  /** 进区域 */
  In(0),
  /** 出区域 */
  Out(1);

  InOutAreaDirectionEnum( int id ){
    this.id = id;
  }

  private int id;

  private static final Map<Integer,InOutAreaDirectionEnum> ID_MAP;

  static{
    ID_MAP = new TreeMap<>();
    InOutAreaDirectionEnum[] values = InOutAreaDirectionEnum.values();
    for(InOutAreaDirectionEnum value : values){
      ID_MAP.put(value.id, value);
    }
  }

  public static InOutAreaDirectionEnum map( int id ){
    InOutAreaDirectionEnum locationAdditionInfoEnum = ID_MAP.get(id);
    assert locationAdditionInfoEnum != null;
    return locationAdditionInfoEnum;
  }
}
